#ifndef FIR_WINDOW_H_
#define FIR_WINDOW_H_

#include <Windows.h>
#include "resource.h"

typedef struct {
    int x;
    int y;
} Point;

class Window {
protected:
    HWND window_handle;
    HINSTANCE instance_handle;

protected:
    virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

    BOOL CreateEx(DWORD dwExStyle, LPCTSTR lpszClass, LPCTSTR lpszName, DWORD dwStyle, 
        int x, int y, int nWidth, int nHeight, HWND hParent, HMENU hMenu, HINSTANCE hInst);

    BOOL RegisterClass(LPCTSTR lpszClass, HINSTANCE hInst);

    virtual void GetWndClassEx(WNDCLASSEX & wc);

    void ShowWindow(BOOL show) const;

    void Destroy(void);


    static LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

protected:
    virtual void OnCreate( HWND hWnd, LPCREATESTRUCT lpCreateStruct);
    virtual void OnNotify( int idCtrl, LPNMHDR pnmh );
    virtual void OnCommand(int wmId, int wmEvent, LPARAM lParam);
    virtual void OnPaint();
    virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
    virtual void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
    virtual void OnLButtonDown(UINT nFlags, Point point );
    virtual void OnMouseMove(UINT nFlags, Point point);


public:
    Window();
    ~Window();

    static int MessageLoop(void);

};

#endif // FIR_WINDOW_H_